package org.zhadoop.stream.cql.semanticanalyzer.parser.visitor;

import org.antlr.v4.runtime.misc.NotNull;
import org.zhadoop.stream.cql.semanticanalyzer.parser.CQLParser.ArithmeticStarOperatorContext;
import org.zhadoop.stream.cql.semanticanalyzer.parser.CQLParser.FieldExpressionContext;
import org.zhadoop.stream.cql.semanticanalyzer.parser.context.ArithmeticStarExpressionContext;

/**
 * 算术乘除语法遍历
 * @author zwd
 *
 */
public class ArithmeticStarExpressionVisitor extends AbsCQLParserBaseVisitor<ArithmeticStarExpressionContext>{

	private ArithmeticStarExpressionContext context = null;

	public ArithmeticStarExpressionVisitor() {
		context = new ArithmeticStarExpressionContext();
	}
	
	@Override
	protected ArithmeticStarExpressionContext defaultResult() {
		return context;
	}
	
	@Override
	public ArithmeticStarExpressionContext visitFieldExpression(@NotNull FieldExpressionContext ctx) {
		FieldExpressionVisitor visitor = new FieldExpressionVisitor();
        context.getFieldExpressions().add(visitor.visit(ctx));
        return context;
	}
	
	@Override
	public ArithmeticStarExpressionContext visitArithmeticStarOperator(@NotNull ArithmeticStarOperatorContext ctx) {
		context.getOperator().add(ctx.getText());
        return context;
	}

}
